This invention is in the field of signal conversion, and is more specifically directed to the pulse-width modulation (PWM) of pulse-code modulated (PCM) signals.
As is well known in the communications art, information can be communicated by way of modulations in an electrical signal. Many classes of modulation approaches are well-known in the art, including amplitude modulation, frequency modulation, and phase modulation. In the digital signal domain, pulse-code modulation (PCM) refers to amplitude modulation in which the amplitude of each pulse of a periodic signal train is quantized into one of a number of available amplitude levels, each available amplitude level corresponding to the value of a digital word. Pulse-width modulation (PWM) is another well-known modulation approach, in which the duty cycle of each pulse in a signal train indicates the digital word value.
Certain electronic systems require the conversion of a signal from one modulation scheme to another. For example, modem digital audio systems typically carry out digital audio signal processing, such as the application of digital filters and the like, upon PCM digital signals, because the clock rate for such processing can be kept relatively slow. On the other hand, digital audio amplifiers (i.e., Class D amplifiers) drive speakers with PWM signals at a significantly higher frequency, to attain good resolution of high frequency audio signal components. Accordingly, these modem digital audio systems must convert the output of the digital audio signal processing functions from PCM signals into the PWM signals appropriate for driving the audio speakers.
FIG. 1a illustrates a PCM signal modulated according to the well-known “AD2” approach, and FIG. 1b illustrates a PWM signal converted from the PCM signal in FIG. 1a. “AD2” conversion refers to controlling a single PWM pulse with two successive PCM sample values; the first PCM sample indicates the location of a rising edge of the PWM signal within a first half-cycle of the PWM signal, and the second PCM sample indicates the location of a falling edge within a second half-cycle of the PWM signal. This approach to pulse-width modulating an input digital sample stream is also referred to as “two-sample consecutive edge PWM”.
The portion of the PCM signal shown in FIG. 1a includes an arbitrary signal expressed as a sequence including four PCM amplitude values x(0) through x(3). The corresponding PWM signal shown in FIG. 1b converted from that PCM signal includes four transition edges at times t(0) through t(3), at a fixed PWM rate expressed as period P. In this conversion, the position in time t(0) of a falling edge of the PWM signal within half-period P/2, corresponds to the amplitude of sample x(0) in the PCM signal. Time t(1) of the next rising edge, within the next half-period P/2, corresponds to the amplitude of the next sample x(1) in the PCM signal. In general, the AD2 mapping of PCM signal x(k) to a corresponding PWM signal expressed as a sequence of the transition times t(k), follows:
                              t          ⁡                      (            k            )                          =                                            P              2                        ⁢                          (                              k                +                1                            )                                +                                    P              4                        ⁢                                          (                                  -                  1                                )                            k                        ⁢                          x              ⁡                              (                k                )                                                                        (        1        )            The factor (−1)k ensures that falling edges move in a positive direction in time and rising edges move in a negative direction in time with increasing x(k). The PWM signal can also be expressed in terms of the durations d(k) of pulse segments in the sequence, by way of:
                                                                        d                ⁡                                  (                  k                  )                                            =                                                t                  ⁡                                      (                    k                    )                                                  -                                  t                  ⁡                                      (                                          k                      -                      1                                        )                                                                                                                          =                                                                    1                    2                                    ⁢                  P                                +                                                                                                    (                                                  -                          1                                                )                                            k                                        4                                    ⁢                                      P                    ·                                          (                                                                        x                          ⁡                                                      (                            k                            )                                                                          +                                                  x                          ⁡                                                      (                                                          k                              -                              1                                                        )                                                                                              )                                                                                                                              (        2        )            These expressions accurately describe the PCM-PWM mapping for fixed time periods P of the PWM signal. In practice, however, the transition times t(k) resulting from the conversion must be aligned with a clock grid that is defined by the master PWM clock. This requires that all pulse durations d(k) of the PWM signal equal integer multiples of periods of the master high-speed PWM clock.
To ensure this edge alignment of the resulting PWM signal, conventional PCM-PWM conversion quantizes the PCM signal x(k) to only those values that map to transition times aligned with the PWM clock. FIG. 2 illustrates this approach in block diagram form. In this arrangement, the input PCM signal stream {tilde over (x)}(k) is applied to quantizer 2, which produces a quantized PCM signal x(k) at levels that guarantee that the corresponding PWM transition times t(k) align with the PWM clock grid. Quantizer 2 is a conventional fixed uniform quantizer function, given a fixed PWM period P at a integer multiple of the fundamental PWM clock period. Loop filter 6 applies noise shaping to quantizer 2, based on the error in the quantized PCM signal x(k). Conversion function 4 converts the quantized PCM signal x(k) to pulse segment duration sequence d(k). Sequence d(k) is applied to a conventional PWM output stage 7, which in response produces a continuous-time pulse-width modulated signal PWM(t), at the fixed PWM clock rate and at a duty cycle corresponding to the pulse segment durations d(k). Conceptually, non-linear feedback from the output of conversion function 4 corrects for the inherent nonlinearity of the PCM to PWM mapping. In practice, the quantized PCM signal x(k) feeds a non-linear model to produce the feedback signal into the noise shaping loop filter, or a feed-forward correction is produced according to a non-linear model. Such non-linear correction is well-known in the art, for example as described in my U.S. Pat. No. 6,657,566 B1, incorporated herein by this reference. As described above, the quantization applied by quantizer 2 ensures that the transitions t(k) corresponding to the pulse segment duration sequence d(k) are aligned with the clock grid of the PWM clock.
While the scheme of FIG. 2 efficiently and accurately converts the input PCM signal stream {tilde over (x)}(k) to a PWM output signal, this quantization and conversion approach holds only for a PWM period P at an integer multiple of the PWM clock rate. This constraint on the PWM signal eliminates the possibility of dynamically varying the PWM clock rate during operation.
By way of further background, the dynamic variation of the PWM output signal rate can be useful in certain system applications. For example, it is desirable to produce the PWM signal at a period P that is selected to avoid harmonic frequencies that interfere with AM radio reception. In addition, it may be desirable in many applications to implement spread spectrum frequency modulation of the PWM signal, which requires dynamic variation of the PWM frequency. However, these selectable or dynamically varying PWM periods are, in general, not compatible with maintaining the PWM period only at integer multiples of the master PWM clock period. In addition, abrupt or dynamic changes in the PWM period generally produce wide-band noise, including substantial noise energy in the audio band.